package com.aiex.framework.security.service;

import com.aiex.framework.security.bo.LoginUser;
import jakarta.servlet.http.HttpServletRequest;

public interface TokenService {

    /**
     * 生成token
     * @param loginUser
     * @return
     */
    String genToken(LoginUser loginUser);

    /**
     * 从request中获取token
     * @param request
     * @return
     */
    String getToken(HttpServletRequest request);

    /**
     * 从request获取登录信息
     * @param request
     * @return
     */
    LoginUser getLoginUser(HttpServletRequest request);

    /**
     * 校验token
     * @param token
     */
    void verifyToken(String token);

    /**
     * 校验token
     * @param request
     */
    void verifyToken(HttpServletRequest request);

    /**
     * 失效token
     */
    void invalidToken(HttpServletRequest request);
}
